package com.example.LifeCycle.BeanPostProcessor;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Description TODO
 * @Date 2024/5/15 11:53
 * @Created by houjunfeng
 */
@Component
public class MyBeanPostProcessor implements BeanPostProcessor {
    //var1是创建的bean,var2是bean的名字
    @Override
    public Object postProcessBeforeInitialization(Object var1, String var2) throws BeansException{
        System.out.println("postProcessBeforeInitialization==>"+var1+"     "+var2);
        return var1;
    };
    //var1是创建的bean,var2是bean的名字
    @Override
    public Object postProcessAfterInitialization(Object var1, String var2) throws BeansException{
        System.out.println("postProcessAfterInitialization==>"+var1+"     "+var2);
        return var1;
    };
}
